/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: XMQ
 * Date: 2022-05-08
 * Time: 15:18
 */
//类和对象代码应用
public class Data {
    private int year;
    public int month;
    public int day;

    public Data(){
//        year = 1000;
//        month = 9;
//        day = 19;
        this(1000,9,19);
    }
    public Data(int year, int month, int day){
        this.year = year;
        this.month = month;
        this.day = day;
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }

    public void print(){
        System.out.println(year);
        System.out.println(month);
        System.out.println(day);

    }

    public static void main(String[] args) {
        Data data1 = new Data();
        data1.print();
        Data data2 = new Data(2002,6,24);
        data2.print();
        Data data3 = new Data();
        data3.setYear(2001);
        data3.getYear();
        data3.setMonth(1);
        data3.getMonth();
        data3.setDay(10);
        data3.getDay();
        data3.print();
    }
}
